
# 1、all    可迭代对象的值是否全部为True
print(all([]))          # True
print(all([1,'a','']))  # False
print(all([1,'a',0]))  # False
print(all([1,'a',4]))  # True

print("-----------------------------")
#2、any
print(any([]))        #False
print(any([1,'a','']))  # True
print(any([1,'a',0]))  # True
print(any([1,'a',4]))  # True

print("------------------------------")

#3、callable 判断是否为可调用对象
def say():
    a = 33
    print(locals())

class Dog:
    pass

print(object.__dict__)
print(callable(say))  # True
print(callable(Dog))  # True

#4、divmod  计算商和余数, 比如计算分页条目
print(divmod(986, 50))

#5、enumerate
lst = ['a',3,'b',33]
for v in lst:
    print(v)

for v in enumerate(lst):
    print(v)
    # (0, 'a')
    # (1, 3)
    # (2, 'b')
    # (3, 33)
#解压赋值
for index,v in enumerate(lst):
    print(index,v)

print(globals())
say()


#6、isinstance
print(isinstance(Dog(), Dog))
print(dir(Dog()))